<!--
 @description 门店信息创建项
 @fileName CreateItem.vue
 @author zengqiongying
 @created 2023/04/28 14:36:41
-->
<template>
  <div>
    <Cell title="门店经营业务类型" custom isColumn readonly>
      <Tags :list="businessTypeName" />
    </Cell>
    <Cell title="门店名称" :modelValue="modelValue.name" defaultValue="--" readonly />
    <Cell title="门店类型" :modelValue="modelValue.shopClassifyName" defaultValue="--" readonly />
    <Cell title="国别" :modelValue="modelValue.countryName" defaultValue="--" readonly />
    <Cell title="所在区域" :modelValue="cityName" defaultValue="--" readonly />
    <Cell title="详细地址" :modelValue="modelValue.shopAddr" defaultValue="--" readonly custom />
    <Cell title="所在楼层" :modelValue="modelValue.floor" defaultValue="--" readonly />
    <Cell title="城市级别" :modelValue="modelValue.cityLevelName" defaultValue="--" readonly />
    <Cell title="市场层级" :modelValue="modelValue.marketLevelName" defaultValue="--" readonly />
    <Cell title="门店咨询电话" :modelValue="modelValue.shopInfoPhone" defaultValue="--" readonly />
    <Cell title="售后电话" :modelValue="modelValue.shopServPhone" defaultValue="--" readonly />
    <Cell title="出图总面积(㎡)" :modelValue="modelValue.outpicArea" defaultValue="--" readonly />
    <Cell title="是否装修门头" :modelValue="modelValue.isDecorationDoorHead ? '是' : '否'" defaultValue="--" readonly />
    <Cell
      v-if="modelValue.isDecorationDoorHead"
      title="门头面积(㎡)"
      :modelValue="modelValue.doorHeadArea"
      defaultValue="--"
      readonly
    />
    <Cell
      title="是否缴纳保证金"
      default-value="--"
      readonly
      :modelValue="[1, '1'].includes(modelValue.isDeposit) ? '是' : '否'"
    />

    <template v-if="[1, '1'].includes(modelValue.isDeposit)">
      <Cell
        title="保证金缴纳日期"
        default-value="--"
        readonly
        :modelValue="parseTime(modelValue.depositDate, '{y}年{m}月{d}日')"
      />
      <Cell title="成品保证金金额" default-value="--" custom readonly> {{ modelValue.finishedDeposit }} 元 </Cell>
      <Cell title="定制保证金金额" default-value="--" custom readonly> {{ modelValue.customizedDeposit }} 元</Cell>
      <Cell title="橱柜保证金金额" default-value="--" custom readonly> {{ modelValue.cupboardDeposit }} 元</Cell>
      <Cell title="卫浴保证金金额" default-value="--" custom readonly> {{ modelValue.bathroomDeposit }} 元</Cell>
    </template>
  </div>
</template>

<script>
  import { reactive, defineComponent, computed } from 'vue'
  import Cell from '@/components/Cell/index.vue'
  import Tags from '@/components/Tags/index.vue'
  import { parseTime } from '@/utils'

  export default defineComponent({
    name: 'DealerCustomerShopsCreateItemView',
    components: { Cell, Tags },
    props: {
      modelValue: {
        type: Object,
        default: () => {}
      }
    },
    setup(props, ctx) {
      const businessTypeName = computed(() => {
        if (props.modelValue.businessTypeName) {
          return `${props.modelValue.businessTypeName}`.split(',')
        }
        return []
      })

      const cityName = computed(() => {
        const { provinceName, cityName, countyName, townName } = props.modelValue
        return `${provinceName || ''}${cityName || ''}${countyName || ''}${townName || ''}`
      })
      return {
        businessTypeName,
        cityName,
        parseTime
      }
    }
  })
</script>
<style lang="less" scoped></style>
